import datetime
from applications.extensions import db


class YeDictionary(db.Model):
    __tablename__ = 'ye_dictionary'
    __table_args__ = ({'comment': '字典表  -保存各种系统字典数据 : 例如可能会保存按键与编码映射关系 :  A映射的winApi中的编码;'})  # 添加表注释
    id = db.Column(db.Integer, autoincrement=True, primary_key=True, comment="表id")
    name = db.Column(db.String(50), comment="名称")
    remarks = db.Column(db.String(500), comment="备注")
    code = db.Column(db.String(50), default=datetime.datetime.now, comment='编码')
    show_value = db.Column(db.String(500), comment='显示值')
    value = db.Column(db.String(500), comment='值')
    create_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')
    update_time = db.Column(db.DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now, comment='更新时间')

